package HomeWork2;

import java.io.*;
import java.util.Scanner;

//编写程序，程序运行后，
// 根据屏幕提示输入一个数字字符串，
// 输入后统计有多少个偶数数字和奇数数字。
public class HomeWork0323 {
    public static int count;
    public static int add;

    public static void main(String[] args) throws Exception {
        Scanner scanner=new Scanner(System.in);
        //String num=scanner.next();
        File fl=new File("D:\\Data.txt");
        fl.createNewFile();

        FileOutputStream fos=null;
        DataOutputStream dos=null;
        fos = new FileOutputStream(fl);
        dos = new DataOutputStream(fos);
        dos.writeUTF(scanner.nextLine());



        FileInputStream fis=null;
        fis=new FileInputStream("D:\\Data.txt");

        while (fis.read() != -1){
                if (fis.read()%2 ==0){
                    count += 1;
                }else if (fis.read()%2!=0) {
                    add += 1;
                }
        }
        fis.close();
        dos.close();
        fos.close();

        System.out.println("偶数个数："+count);
        System.out.println("奇数个数："+add);
    }
}